const mongoose = require('mongoose');
const Schema = mongoose.Schema;

/**
 * 字典表
 */
const DictType = new Schema({
  //  命名空间
  name: {
    type: String,
    required: true,
  },
  label: {
    type: String,
    required: true,
  },
  value: {
    type: String,
    required: true,
  },
  description: {
    type: String,
    default: '', // 描述
  },
  createTime: {
    type: Date,
    default: Date.now,
  },
  updateTime: {
    type: Date,
    default: Date.now,
  },
});

const DictModel = mongoose.model('dict', new Schema(DictType));

module.exports = DictModel;
